package com.cskaoyan.controller.front.user;


import com.cskaoyan.bean.vo.back.BaseRespVo;
import com.cskaoyan.bean.vo.front.user.OrderStateVo;
import com.cskaoyan.bean.vo.front.user.UserIndex;
import com.cskaoyan.service.front.user.WXUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("wx/user")
@RestController
public class WXUserController {

    @Autowired
    WXUserService wxUserService;

    /**
     * 显示当前登录用户的不同订单状态数量
     *
     * @return 不同订单状态数量
     */
    @GetMapping("index")
    public BaseRespVo getUserIndex() {
        OrderStateVo stateVo = wxUserService.getUserIndex();
        UserIndex userIndex = new UserIndex(stateVo);
        return BaseRespVo.ok(userIndex);
    }
}
